import { NextAuthOptions } from 'next-auth';

export const authOptions: NextAuthOptions = {
  providers: [
    // 临时使用简单的凭据提供者
    {
      id: 'credentials',
      name: 'Credentials',
      type: 'credentials',
      credentials: {},
      authorize: async () => {
        // 临时返回一个模拟用户
        return {
          id: 'temp-user-id',
          name: '测试用户',
          email: 'test@example.com'
        };
      }
    }
  ],
  session: {
    strategy: 'jwt'
  },
  callbacks: {
    jwt: async ({ token, user }) => {
      if (user) {
        token.id = user.id;
      }
      return token;
    },
    session: async ({ session, token }) => {
      if (token) {
        session.user.id = token.id as string;
      }
      return session;
    }
  }
};